Skip to content

feat(models): add get_update_marker() for google-adk 1.28.0 compatibility#154

Merged
Alberto-Codes merged 1 commit into
mainfrom
feat/adk-128-get-update-marker
Mar 29, 2026
Merged

feat(models): add get_update_marker() for google-adk 1.28.0 compatibility#154
Alberto-Codes merged 1 commit into
mainfrom
feat/adk-128-get-update-marker

Conversation

@Alberto-Codes
Copy link
Copy Markdown
Owner

google-adk 1.28.0 introduces get_update_marker() on StorageSession for string-based optimistic concurrency, replacing float timestamp comparison. Without this method, EncryptedStorageSession raises AttributeError when append_event() is called under 1.28.0.

  • Add get_update_marker() returning ISO 8601 with microsecond precision
  • Add update_timestamp_tz property (closes pre-existing parity gap with upstream)
  • Update to_session() to stamp _storage_update_marker on returned Session
  • Add sentinel test verifying duck-type parity with ADK StorageSession
  • Add unit tests for marker format, UTC normalization, and round-trip

Test: uv run pytest tests/unit/test_models.py tests/integration/test_adk_conformance.py -v


PR Review

Checklist

  • Self-reviewed my code
  • Tests pass (uv run pytest)
  • Lint passes (uv run ruff check .)
  • Breaking changes use ! in title and BREAKING CHANGE: in body

Review Focus

  • update_timestamp_tz hardcodes is_sqlite=False (diverges from upstream's dynamic detection via inspect(self).session). Documented in a Note: block. Revisit after 1.28.0 upgrade.
  • _storage_update_marker is set via direct assignment on Session (valid Pydantic v2 underscore attr). In 1.28.0 it becomes a proper PrivateAttr(default=None).

Related

…lity

google-adk 1.28.0 introduces get_update_marker() on StorageSession for
string-based optimistic concurrency, replacing float timestamp comparison.
Without this method, EncryptedStorageSession raises AttributeError when
append_event() is called under 1.28.0.

- Add get_update_marker() returning ISO 8601 with microsecond precision
- Add update_timestamp_tz property (pre-existing parity gap with upstream)
- Update to_session() to stamp _storage_update_marker on returned Session
- Add sentinel test verifying duck-type parity with ADK StorageSession
- Add unit tests for marker format, UTC normalization, and round-trip
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Alberto-Codes Alberto-Codes marked this pull request as ready for review March 29, 2026 01:42
Copilot AI review requested due to automatic review settings March 29, 2026 01:42
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds forward-compatibility with google-adk 1.28.0’s string-based optimistic concurrency by implementing get_update_marker()/update_timestamp_tz parity on the encrypted StorageSession model and ensuring returned Session objects are stamped with _storage_update_marker.

Changes:

  • Add EncryptedStorageSession.get_update_marker() and update_timestamp_tz for ADK StorageSession parity.
  • Update to_session() to stamp _storage_update_marker on the returned ADK Session.
  • Add unit + integration sentinel tests to validate marker behavior and duck-typed parity with ADK’s StorageSession.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/adk_secure_sessions/services/models.py Implements get_update_marker(), adds update_timestamp_tz, and stamps _storage_update_marker in to_session() for optimistic concurrency compatibility.
tests/unit/test_models.py Adds unit tests for marker formatting/UTC normalization, update_timestamp_tz, and _storage_update_marker stamping.
tests/integration/test_adk_conformance.py Adds a sentinel parity test against upstream StorageSession and round-trip assertions that _storage_update_marker is populated.
_bmad-output/implementation-artifacts/tech-spec-adk-128-get-update-marker.md Documents the implementation plan and acceptance criteria for the ADK 1.28.0 compatibility work.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/adk_secure_sessions/services/models.py
Comment thread tests/integration/test_adk_conformance.py
@Alberto-Codes Alberto-Codes merged commit 4411319 into main Mar 29, 2026
14 checks passed
@Alberto-Codes Alberto-Codes deleted the feat/adk-128-get-update-marker branch March 29, 2026 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants